package cn.oa.controller;

import java.util.HashMap;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import cn.oa.service.CountService;

@Controller
public class CountController {
	@Resource
	CountService countService;
	@ResponseBody
	@GetMapping("/count")
	public Map<String, Object> count(){
		Map<String, Object> map = new HashMap<>();
		map.put("AllAnnNum", countService.AllAnnNum());
		map.put("AllMsgNum", countService.AllMsgNum());
		map.put("DeAnnNum", countService.DeAnnNum());
		map.put("DepartmentName", countService.DepartmentName());
		map.put("DepartmentNum", countService.DepartmentNum());
		map.put("UnReadMsgNum", countService.UnReadMsgNum());
		return map;
	}
}
